import { defineMock } from '@alova/mock'
import { resultSuccess } from './_utils'

export default defineMock({
  '[POST]/api/auth/login': ({ data }) => {
    const { username } = data
    return resultSuccess({
      token: username,
    })
  },
  '[POST]/api/auth/logout': ({ data }) => {
    const { username } = data
    return resultSuccess({
      token: username,
    })
  },
  '/api/auth/info': () => {
    return resultSuccess({
      id: 1,
      username: 'admin',
      nickname: '超级管理员',
      avatar: '',
      codes: [],
      roles: [],
    })
  },
})
